package com.hedd.shop.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hedd.shop.mapper.GoodsMapper;
import com.hedd.shop.pojo.entity.GoodInfo;
import com.hedd.shop.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service

public class GoodsServiceImpl  implements GoodsService {
    @Autowired
    private GoodsMapper goodsMapper;

    public PageInfo<GoodInfo> selectGoodsByUser(int pageIndex, int pageSize,Long uid){
        PageHelper.startPage(pageIndex, pageSize);

        List<GoodInfo> goodsList = goodsMapper.selectGoodsByUser(uid);

        PageInfo<GoodInfo> collectionsPageInfo = new PageInfo<GoodInfo>(goodsList);

        return collectionsPageInfo;
    }
}
